/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Windsea
 */
public class ConnectDB {

    private static Connection con;

    //~Tạo kết nối Database
    public static Connection createMySQLconnection(String database) throws Exception {
        String url = "com.mysql.jdbc.Driver";
        Class.forName(url);
        String dbURL = "jdbc:mysql://localhost:3306/" + database + "?user=root&password=&useUnicode=true&characterEncoding=UTF-8";
        con = DriverManager.getConnection(dbURL);
        return con;

    }
}
